<template>
  <div class="header" v-if="city">
    <div class="header-left iconfont" >&#xe624;</div>
    <div class="header-input">
      <span class="iconfont">&#xe60b;</span>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{city}}
        <span class="iconfont city-icon">&#xe639;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
export default {
  name: 'HomeHeader',
  props: {
    city: {
      type: String,
      required: true
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/variables.styl'
.header
  display: flex
  background: $bgColor
  color: #fff
  height: $headrHeight
  line-height: $headrHeight
  .header-left
    float: left
    width: .6rem
    font-size: .36rem
    font-weight: bold
    padding-left: .2rem
  .header-input
    flex: 1
    background: #fff
    margin: .14rem .02rem
    height .6rem
    line-height: .6rem
    border-radius: .1rem
    color: #ccc
    padding-left:.2rem
  .header-right
    float: right
    width: 1.28rem
    text-align: center
    color: #fff
    .city-icon
      margin-left: -.04rem
</style>
